Skip to content

feat: convert into yii2-extensions/scaffold provider; centralize ECS, Rector, metadata and super-linter standards under src/.#4

Merged
terabytesoftw merged 2 commits into
mainfrom
feature_2
May 5, 2026
Merged

feat: convert into yii2-extensions/scaffold provider; centralize ECS, Rector, metadata and super-linter standards under src/.#4
terabytesoftw merged 2 commits into
mainfrom
feature_2

Conversation

@terabytesoftw

Copy link
Copy Markdown
Contributor

Pull Request

  • Breaking change (fix or feature that would cause existing functionality to change)
  • Bugfix (non-breaking change that fixes an issue)
  • CI/build configuration
  • Documentation update
  • New feature (non-breaking change that adds functionality)
  • Refactoring (no functional changes)

…S, Rector, metadata and super-linter standards under `src/`.
@coderabbitai

coderabbitai Bot commented May 4, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@terabytesoftw has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 41 minutes and 44 seconds before requesting another review.

To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: cf211779-789e-436a-840f-7d16511ff4c5

📥 Commits

Reviewing files that changed from the base of the PR and between 7bba3a7 and 643b892.

📒 Files selected for processing (15)
  • .editorconfig
  • .github/linters/.gitleaks.toml
  • .prettierrc.json
  • CHANGELOG.md
  • README.md
  • composer.json
  • docs/installation.md
  • src/ecs-81.php
  • src/ecs-82.php
  • src/ecs-83.php
  • src/ecs-84.php
  • src/rector-81.php
  • src/rector-82.php
  • src/rector-83.php
  • src/rector-84.php
📝 Walkthrough

Walkthrough

This PR transforms the project into a Composer-distributed coding standard package with version-specific ECS and Rector configuration wrappers. A shared base configuration provides common rules, while wrapper files (ecs-81/82/83/84.php, rector-81/82/83/84.php) layer PHP-version-specific migrations. Scaffolding support, linter configurations, and documentation are updated accordingly. Example code is removed.

Changes

Coding Standard Distribution & Configuration

Layer / File(s) Summary
Package Metadata & Distribution
composer.json, composer-require-checker.json, .gitattributes
Package keywords updated to include scaffold-provider; extra scaffolding configuration added with file copy lists and handling modes. .gitattributes export-ignore rules refined to target specific /.github/ files. New composer-require-checker.json configuration file created.
Shared Configuration Foundation
src/ecs.php, src/rector.php
Refactored as distribution-friendly base files with no project-specific paths. src/ecs.php explicitly enables strict-typing fixers instead of using deprecated prepared-set. src/rector.php applies only SetList::TYPE_DECLARATION, delegating PHP-version sets to wrappers. Both include documentation directing consumers to version wrappers.
Version-Specific ECS Wrappers
src/ecs-81.php, src/ecs-82.php, src/ecs-83.php, src/ecs-84.php
Four new configuration files, each requiring the shared ecs.php and returning builder with PHP-version-specific migrations (php81Migration, php82Migration, php83Migration, php84Migration).
Version-Specific Rector Wrappers
src/rector-81.php, src/rector-82.php, src/rector-83.php, src/rector-84.php
Four new configuration closures, each requiring shared rector.php and registering version-specific Rector sets (LevelSetList::UP_TO_PHP_* and SetList::PHP_*).
Root-Level Project Integration
ecs.php, rector.php
Root files now import vendor-based shared configs (vendor/php-forge/coding-standard/src/ecs-83.php, vendor/php-forge/coding-standard/src/rector-83.php) instead of local config directories, and scan src/ and tests/ instead of config/.
Root-Level Example Removal
src/Example.php, tests/ExampleTest.php
Removed placeholder example class and its test case to clean up the distribution package.
Tool & Linter Configuration
.ecrc, .github/linters/.codespellrc, .github/linters/.gitleaks.toml, .github/linters/.markdown-lint.yml, .prettierignore, .prettierrc.json, .stylelintignore, .gitignore, .github/workflows/ecs.yml
New/updated linter configurations to exclude minified assets, test runtime directories, vendor paths, and specific file patterns. Prettier/Stylelint/Codespell/GitLeaks rules configured for project standards. ECS workflow updated to use versioned config. .gitignore extended for phpactor.
Documentation & README
README.md, docs/configuration.md, docs/development.md, docs/examples.md, docs/installation.md, docs/testing.md, CHANGELOG.md
README expanded with configuration table, scaffolding section, and updated version matrix for ecs-*/rector-* wrappers. Minimum PHP version raised to 8.3. Installation guide updated for php-forge/coding-standard:^0.2. Development, testing, and examples docs removed; configuration doc cleared. Changelog restructured with Conventional Commits format and new 0.2.0 section.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • php-forge/coding-standard#1: Refactors the same ecs.php/rector.php structure to support Composer distribution with version-specific wrapper configuration files and shared base configs.

Suggested labels

enhancement


🐰 Whiskers twitching with joy—the standard now hops

From folder to vendor, migrations at top,

Each PHP version gets its own wrapper wrapped tight,

Scaffolding spreads the good fixer light!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: converting the project into a scaffold provider and centralizing ECS/Rector/linter standards under src/.
Description check ✅ Passed The description is a breaking change checklist that relates to the PR's intent, though minimal in detail.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature_2

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot added the enhancement New feature or request label May 4, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 12

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/linters/.gitleaks.toml:
- Around line 3-7: Replace the deprecated single-table header [allowlist] with
the array-of-tables header [[allowlists]] and move the existing keys
(description and paths) under that new table so the file uses the modern
gitleaks syntax; specifically, change the block beginning with [allowlist] to
start with [[allowlists]] and keep the description and paths array (including
the '''tests/support/data/.*\.php''' entry) unchanged so semantics are
preserved.

In @.prettierrc.json:
- Around line 9-20: The patterns in the "files" array currently use root-level
globs (e.g., "*.js", "*.ts", "*.vue") which won't match nested files; update
each pattern in that array to a recursive glob (replace "*.ext" with "**/*.ext")
so Prettier overrides apply to files in subdirectories (e.g., change "*.js" →
"**/*.js", "*.ts" → "**/*.ts", etc.).

In `@CHANGELOG.md`:
- Around line 8-12: Update the 0.2.0 changelog entry to explicitly mark the
change as breaking: modify the "## 0.2.0 Under development" section (the 0.2.0
entry) to replace or augment the current "- feat: convert into
`yii2-extensions/scaffold` provider..." line with a "- BREAKING CHANGE: ..."
prefix and add a short migration note explaining what consumers must change
(e.g., provider name change, config/key paths, or any renamed classes/APIs) so
users can follow upgrade steps; ensure the new text references the same 0.2.0
heading and mentions the concrete migration action(s) required.

In `@docs/installation.md`:
- Around line 24-26: The manual composer example places
"php-forge/coding-standard" under "require" but the earlier instruction uses dev
install; change the JSON key in the example from "require" to "require-dev" so
the package appears as a dev dependency (i.e., move "php-forge/coding-standard":
"^0.2" under "require-dev") to keep the docs consistent and prevent production
installs.

In `@rector.php`:
- Line 8: Add a clear comment in rector.php next to the import call
($rectorConfig->import(... 'rector-83.php')) instructing consumers to replace
that import with the version-specific file matching their project's PHP
constraint in composer.json; then update docblock examples in src/rector-81.php,
src/rector-82.php, src/rector-83.php and src/rector-84.php so they reference the
correct src/ paths (not config/) and ensure src/rector-82.php fixes the
erroneous import of rector-81.php to import the correct rector-82.php file and
any mismatched Set/Level references.

In `@src/ecs-81.php`:
- Around line 15-18: The example require path in src/ecs-81.php is pointing to
vendor/php-forge/coding-standard/config/ecs-81.php which doesn't exist; update
the require to reference the installed location under src (e.g.
vendor/php-forge/coding-standard/src/ecs-81.php) so the $builder = require ...
line resolves correctly (same fix applied as in src/ecs-84.php).

In `@src/ecs-83.php`:
- Around line 15-18: Update the require path used to load the ECS config in
src/ecs-83.php so it points to the package's src location rather than config;
change the string passed to the require for the $builder assignment (the line
with $builder = require ...) to
'/vendor/php-forge/coding-standard/src/ecs-83.php' (matching how src/ecs-81.php
and src/ecs-84.php reference the package) so the docblock/example uses the
correct installed path.

In `@src/ecs-84.php`:
- Around line 15-18: The example require path in the docblock is incorrect and
points to config/ecs-84.php which doesn't exist; update the require invocation
that assigns $builder (the line using require __DIR__ .
'/vendor/php-forge/coding-standard/config/ecs-84.php') to reference the
installed location under src (e.g. require __DIR__ .
'/vendor/php-forge/coding-standard/src/ecs-84.php') so the $builder variable is
loaded correctly and the subsequent call to $builder->withPaths([...]) works.

In `@src/rector-81.php`:
- Around line 21-23: Update the example import path in the docblock: the example
using $rectorConfig->import(__DIR__ .
'/vendor/php-forge/coding-standard/config/rector-81.php') is outdated after
centralizing files under src/; change it to point to the new location (e.g.
$rectorConfig->import(__DIR__ .
'/vendor/php-forge/coding-standard/src/rector-81.php') or the exact new path
where rector-81.php now lives) so the example reflects the relocated file in
rector-81.php.

In `@src/rector-82.php`:
- Around line 21-23: The import in the anonymous config function calls the wrong
wrapper file: update the string passed to $rectorConfig->import (currently
referencing 'rector-81.php') to reference the 8.2 wrapper ('rector-82.php') so
the config uses the correct Rector 8.2 rules; ensure the $rectorConfig->import
call now points to 'vendor/php-forge/coding-standard/config/rector-82.php'.

In `@src/rector-83.php`:
- Around line 30-35: The sets call is redundant: remove the explicit
SetList::PHP_83 entry from the $rectorConfig->sets([...]) call so only
LevelSetList::UP_TO_PHP_83 remains; locate the $rectorConfig->sets invocation
(currently listing LevelSetList::UP_TO_PHP_83 and SetList::PHP_83) and delete
the SetList::PHP_83 element, leaving a single LevelSetList::UP_TO_PHP_83 entry.
- Around line 21-24: The docblock example uses the wrong package path: update
the Rector config import in the anonymous return function so the call to
$rectorConfig->import(...) points to
'/vendor/php-forge/coding-standard/src/rector-83.php' (not
'/vendor/.../config/...'), i.e. edit the import argument inside the static
function where $rectorConfig->import is invoked to reference the src directory
so consumers won't get a fatal missing-file error.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 722dccd5-2aeb-4ba5-982a-be001f8c8cc6

📥 Commits

Reviewing files that changed from the base of the PR and between 1924ab4 and 7bba3a7.

⛔ Files ignored due to path filters (2)
  • docs/svgs/features-mobile.svg is excluded by !**/*.svg
  • docs/svgs/features.svg is excluded by !**/*.svg
📒 Files selected for processing (34)
  • .ecrc
  • .gitattributes
  • .github/linters/.codespellrc
  • .github/linters/.gitleaks.toml
  • .github/linters/.markdown-lint.yml
  • .github/workflows/ecs.yml
  • .gitignore
  • .prettierignore
  • .prettierrc.json
  • .stylelintignore
  • CHANGELOG.md
  • README.md
  • composer-require-checker.json
  • composer.json
  • docs/configuration.md
  • docs/development.md
  • docs/examples.md
  • docs/installation.md
  • docs/testing.md
  • ecs.php
  • rector.php
  • src/Example.php
  • src/ecs-81.php
  • src/ecs-82.php
  • src/ecs-83.php
  • src/ecs-84.php
  • src/ecs.php
  • src/rector-81.php
  • src/rector-82.php
  • src/rector-83.php
  • src/rector-84.php
  • src/rector.php
  • tests/ExampleTest.php
  • tests/bootstrap.php
💤 Files with no reviewable changes (6)
  • docs/examples.md
  • docs/development.md
  • docs/configuration.md
  • tests/ExampleTest.php
  • docs/testing.md
  • src/Example.php
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: linter / Super Linter
🧰 Additional context used
🪛 LanguageTool
README.md

[uncategorized] ~174-~174: The official name of this software platform is spelled with a capital “H”.
Context: ...ker whitelist (project-specific) | | .github/linters/actionlint.yml | replace...

(GITHUB)


[uncategorized] ~175-~175: The official name of this software platform is spelled with a capital “H”.
Context: ... Super-Linter | | .github/linters/.codespellrc | replace...

(GITHUB)


[uncategorized] ~176-~176: The official name of this software platform is spelled with a capital “H”.
Context: ... | | .github/linters/.gitleaks.toml | replace...

(GITHUB)


[uncategorized] ~177-~177: The official name of this software platform is spelled with a capital “H”.
Context: ... | | .github/linters/.markdown-lint.yml | replace...

(GITHUB)

🪛 OpenGrep (1.20.0)
src/ecs-84.php

[ERROR] 23-23: Dynamic file path passed to include/require. This can lead to local or remote file inclusion. Use a fixed allowlist of paths.

(coderabbit.file-inclusion.php-dynamic-include)

src/ecs-81.php

[ERROR] 23-23: Dynamic file path passed to include/require. This can lead to local or remote file inclusion. Use a fixed allowlist of paths.

(coderabbit.file-inclusion.php-dynamic-include)

src/ecs-82.php

[ERROR] 23-23: Dynamic file path passed to include/require. This can lead to local or remote file inclusion. Use a fixed allowlist of paths.

(coderabbit.file-inclusion.php-dynamic-include)

src/rector-82.php

[ERROR] 28-28: Dynamic file path passed to include/require. This can lead to local or remote file inclusion. Use a fixed allowlist of paths.

(coderabbit.file-inclusion.php-dynamic-include)

src/rector-84.php

[ERROR] 28-28: Dynamic file path passed to include/require. This can lead to local or remote file inclusion. Use a fixed allowlist of paths.

(coderabbit.file-inclusion.php-dynamic-include)

src/rector-83.php

[ERROR] 28-28: Dynamic file path passed to include/require. This can lead to local or remote file inclusion. Use a fixed allowlist of paths.

(coderabbit.file-inclusion.php-dynamic-include)

ecs.php

[ERROR] 6-6: Dynamic file path passed to include/require. This can lead to local or remote file inclusion. Use a fixed allowlist of paths.

(coderabbit.file-inclusion.php-dynamic-include)

src/rector-81.php

[ERROR] 27-27: Dynamic file path passed to include/require. This can lead to local or remote file inclusion. Use a fixed allowlist of paths.

(coderabbit.file-inclusion.php-dynamic-include)

src/ecs-83.php

[ERROR] 23-23: Dynamic file path passed to include/require. This can lead to local or remote file inclusion. Use a fixed allowlist of paths.

(coderabbit.file-inclusion.php-dynamic-include)

🔇 Additional comments (16)
.stylelintignore (1)

1-1: LGTM.

.gitignore (1)

31-32: LGTM.

composer-require-checker.json (1)

1-3: LGTM.

.github/linters/.codespellrc (1)

1-2: LGTM.

.github/linters/.markdown-lint.yml (1)

1-5: LGTM.

.prettierignore (1)

1-18: LGTM.

.ecrc (1)

1-10: Looks good — exclude patterns are coherent and scoped.

This exclusion list is consistent with the repo’s tooling/runtime boundaries.

.gitattributes (1)

25-37: Archive and merge attributes update looks consistent.

Targeted .github exclusions plus retained CHANGELOG.md merge=union are sensible here.

src/rector.php (1)

11-18: Base Rector config documentation is clear and matches implementation.

The version-agnostic base plus wrapper layering guidance is well aligned with the config body.

src/rector-84.php (1)

27-35: Wrapper layering is implemented correctly.

The base import + PHP 8.4 set layering matches the intended architecture.

src/ecs.php (1)

95-103: LGTM — explicit strict fixers correctly replace the deprecated strict: true prepared set.

The three extracted fixers (DeclareStrictTypesFixer, StrictComparisonFixer, StrictParamFixer) match exactly what the deprecated set bundled, preserving behavior while giving consumers direct control over each rule.

ecs.php (1)

5-13: LGTM — correct path and clean consumer pattern.

The src/ path in Line 6 correctly matches where the versioned wrapper is installed, and the builder is properly extended with project-specific paths. This file also serves as the authoritative reference showing src/ (not config/) as the correct consumer include path.

composer.json (1)

28-51: LGTM — scaffold configuration is well-structured.

Mode choices are appropriate: "preserve" for consumer-owned configs (ecs.php, rector.php, composer-require-checker.json) avoids overwriting downstream customizations, and "append" for .gitignore is the correct strategy for extending rather than replacing consumer ignore rules.

.github/workflows/ecs.yml (1)

22-23: LGTM — CI command is consistent with the updated composer.json scripts.

Using check src without --fix in CI is the correct pattern (report violations, don't silently mutate), and --ansi improves log readability.

src/ecs-82.php (1)

3-25: Looks good — clean versioned ECS wrapper.

strict_types, fixed local import, and PHP 8.2 migration-set layering are consistent and safe here.

README.md (1)

29-199: Documentation restructure is clear and actionable.

The config matrix + scaffold section reads consistently and aligns with the new provider model.

Comment thread .github/linters/.gitleaks.toml Outdated
Comment thread .prettierrc.json Outdated
Comment thread CHANGELOG.md
Comment thread docs/installation.md Outdated
Comment thread rector.php
Comment thread src/ecs-84.php
Comment thread src/rector-81.php Outdated
Comment thread src/rector-82.php
Comment thread src/rector-83.php
Comment thread src/rector-83.php
@terabytesoftw

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@terabytesoftw terabytesoftw merged commit 8453c16 into main May 5, 2026
21 checks passed
@terabytesoftw terabytesoftw deleted the feature_2 branch May 5, 2026 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant